package com.llly.client;

import com.github.pagehelper.Page;
import com.llly.client.impl.NewsFeignClientImpl;
import com.llly.pojo.Easybuy_news;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Component
@FeignClient(name = "provider9091",fallback = NewsFeignClientImpl.class)
public interface NewsFeignClient {

    //进入新闻页面.
    @RequestMapping("/showNews")
    public Map<String,Object> ShowNews(@RequestParam Integer pageIndex);

    //进入详情方法
    @RequestMapping("/newsView")
    public Easybuy_news newsView(@RequestParam Integer id);

    //增
    @RequestMapping("/addnews")
    public int addnews(@RequestBody Easybuy_news en);

    //删
    @RequestMapping("/delnews")
    public int delnews( @RequestParam Integer id);

    //改
    @RequestMapping("/updatenews")
    public int updatenews(@RequestBody Easybuy_news en);

    //指定id查询
    @RequestMapping("/findById")
    public Easybuy_news findById(@RequestParam Integer id);


}
